<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="layout/blank"><!-- layout文件路径-->

<head>
    <!-- META SECTION -->
    <title>课程中心</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <!-- END META SECTION -->
</head>

<body>
<!-- PAGE CONTENT -->
<div layout:fragment="content">
    <!-- START X-NAVIGATION VERTICAL -->

    <!-- END X-NAVIGATION VERTICAL -->
    <!-- START BREADCRUMB -->
    <ul class="breadcrumb">
        <li><a href="#">Home</a></li>
        <li><a href="/memberCard/list">课程中心</a></li>
        <li class="active">单元列表</li>
    </ul>
    <!-- END BREADCRUMB -->
    <!-- PAGE TITLE -->
    <!-- END PAGE TITLE -->
    <!-- PAGE CONTENT WRAPPER -->
    <div class="page-content-wrap">
        <div class="row">
            <div class="col-md-12">
                <!-- START SIMPLE DATATABLE -->
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">单元列表</h3>
                        <ul class="panel-controls">
                            <li>
                                <div class="pull-right">
                                    <button id="unit-add-button" th:data-levelid="${levelId}" class="btn btn-primary"><span class="fa fa-plus-circle"></span> 新建Unit
                                    </button>
                                </div>
                            </li>
                            <li><a href="#" class="panel-collapse"><span class="fa fa-angle-down"></span></a></li>
                            <li><a href="#" class="panel-refresh"><span class="fa fa-refresh"></span></a></li>
                            <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                        </ul>
                    </div>
                    <div class="panel-body">
                        <table class="table datatable_simple table-hover table-striped">
                            <thead>
                            <tr>
                                <th width="10%">#</th>
                                <th width="30%">名称</th>
                                <th width="10%">教师</th>
                                <th width="10%">价格</th>
                                <th width="40%">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="entity : ${units}">
                                <td th:text="${entityStat.index+1}"></td>
                                <td th:text="${entity.title}"></td>
                                <td th:text="${entity.teacherName}"></td>
                                <td th:if="${entity.free=='0'}" th:text="免费"></td>
                                <td th:if="${entity.free=='1'}" th:text="收费"></td>
                                <td th:if="${memberCard.type=='1'}">
                                    <button class="btn btn-default btn-rounded btn-sm" th:onclick="editUnit(this)" th:data-id="${entity.id}" >编辑</button>
                                    <button class="btn btn-default btn-rounded btn-sm" th:onclick="uploadDocument(this)" th:data-id="${entity.id}" th:data-levelid="${levelId}">上传课件</button>
                                    <button class="btn btn-default btn-rounded btn-sm" th:onclick="unitDetail(this)" th:data-id="${entity.id}" th:data-levelid="${levelId}">查看课程视频</button>
                                    <button class="btn btn-default btn-rounded btn-sm" th:onclick="vocabularyList(this)" th:data-id="${entity.id}" th:data-levelid="${levelId}">读一读</button>
                                    <button class="btn btn-default btn-rounded btn-sm" th:onclick="questionList(this)" th:data-id="${entity.id}" th:data-levelid="${levelId}">练一练</button>
                                </td>
                                <td th:if="${memberCard.type=='4'}">
                                    <button class="btn btn-default btn-rounded btn-sm" th:onclick="editUnit(this)" th:data-id="${entity.id}" >编辑</button>
                                    <button class="btn btn-default btn-rounded btn-sm" th:onclick="uploadDocument(this)" th:data-id="${entity.id}" th:data-levelid="${levelId}">上传pdf</button>
                                    <button class="btn btn-default btn-rounded btn-sm" th:onclick="vocabularyList(this)" th:data-id="${entity.id}" th:data-levelid="${levelId}">编辑详情</button>
                                </td>
                            </tr>

                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- END SIMPLE DATATABLE -->
            </div>
        </div>
    </div>
    <!-- PAGE CONTENT WRAPPER -->

</div>
<!-- START PRELOADS -->
</body>

</html>
